<template>
  <div style="padding: 10px">
    <div>
      <el-form :inline="true" :model="iaForm" size="small" label-width="130px" class="demo-form-inline">
        <el-form-item label="单据编号">
          <el-input v-model="input" placeholder="请输入内容" style="width: 240px"></el-input>
        </el-form-item>
        <el-form-item label="审核人">
          <el-input v-model="input3" placeholder="审核人" class="input-with-select" style="width: 240px" >
            <el-select slot="append" v-model="select" placeholder="选择" style="width: 80px">
              <el-option label="餐厅名" value="1"></el-option>
              <el-option label="订单号" value="2"></el-option>
              <el-option label="用户电话" value="3"></el-option>
            </el-select>
          </el-input>
        </el-form-item>
        <el-form-item label="制单人">
          <el-input v-model="input3" placeholder="制单人" class="input-with-select" style="width: 240px" >
            <el-select slot="append" v-model="select" placeholder="选择" style="width: 80px">
              <el-option label="餐厅名" value="1"></el-option>
              <el-option label="订单号" value="2"></el-option>
              <el-option label="用户电话" value="3"></el-option>
            </el-select>
          </el-input>
        </el-form-item>
        <el-form-item label="生效时间">
          <el-date-picker
            v-model="value1"
            type="datetime"
            suffix-icon="el-icon-date"
            style="width: 240px"
            placeholder="选择日期时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="生效时间">
          <el-date-picker
            v-model="value1"
            type="datetime"
            suffix-icon="el-icon-date"
            style="width: 240px"
            placeholder="选择日期时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="生效时间">
          <el-date-picker
            v-model="value1"
            type="datetime"
            suffix-icon="el-icon-date"
            style="width: 240px"
            placeholder="选择日期时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="处理状态">
          <el-select v-model="iaForm.ia_proc_status" placeholder="处理状态" style="width: 240px">
            <el-option label="编译中" value="shanghai"></el-option>
            <el-option label="区域二" value="beijing"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="是否通过">
          <el-select v-model="iaForm.ia_proc_status" style="width: 111px" >
            <el-option label="是" value="1"></el-option>
            <el-option label="否" value="2"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="是否关闭">
          <el-select v-model="iaForm.ia_proc_status" style="width: 111px" >
            <el-option label="是" value="1"></el-option>
            <el-option label="否" value="2"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="是否作废">
          <el-select v-model="iaForm.ia_proc_status" style="width: 111px" >
            <el-option label="是" value="1"></el-option>
            <el-option label="否" value="2"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="备注">
          <el-input
            :rows="2"
            v-model="textarea"
            type="textarea"
            autosize
            style="width: 1010px">
          </el-input>
        </el-form-item>
        <el-form-item label="附件">
          <el-upload
            :on-preview="handlePreview"
            :on-remove="handleRemove"
            :before-remove="beforeRemove"
            :limit="3"
            :on-exceed="handleExceed"
            :file-list="fileList"
            class="upload-demo"
            action="https://jsonplaceholder.typicode.com/posts/"
            multiple>
            <el-button size="small" icon="el-icon-upload" style="width: 120px">点击上传</el-button>
          </el-upload>
        </el-form-item>
      </el-form>
    </div>
    <div>
      <el-tabs value="first" >
        <el-tab-pane label="明 细" name="first" >
          <el-button type="primary" icon="el-icon-plus" size="small" style="margin-left: 20px" @click="addDomain()">新增</el-button>
          <el-form size="small">
            <el-table
              :data="tableData"
              :align="center"
              max-height="220"
              style="width: 100%">
              <el-table-column type="selection" width="55"></el-table-column>
              <el-table-column label="分录号" align="center">
                <template slot-scope="scope">
                  <el-form-item>
                    <el-input v-model="scope.row.entry_no" readonly></el-input>
                  </el-form-item>
                </template>
              </el-table-column>
              <el-table-column label="物料" width="170" align="center">
                <template slot-scope="scope">
                  <el-form-item>
                    <el-select v-model="scope.row.comm_id">
                      <el-option label="是" value="1"></el-option>
                      <el-option label="否" value="2"></el-option>
                    </el-select>
                  </el-form-item>
                </template>
              </el-table-column>
              <el-table-column label="调出仓库" width="170" align="center">
                <template slot-scope="scope">
                  <el-form-item>
                    <el-select v-model="scope.row.depot_callout">
                      <el-option label="是" value="1"></el-option>
                      <el-option label="否" value="2"></el-option>
                    </el-select>
                  </el-form-item>
                </template>
              </el-table-column>
              <el-table-column label="原库存数量" width="120" align="center">
                <template slot-scope="scope">
                  <el-form-item>
                    <el-input v-model="scope.row.source_amount" disabled></el-input>
                  </el-form-item>
                </template>
              </el-table-column>
              <el-table-column label="调入仓库" width="170" align="center">
                <template slot-scope="scope">
                  <el-form-item>
                    <el-select v-model="scope.row.depot_fold">
                      <el-option label="是" value="1"></el-option>
                      <el-option label="否" value="2"></el-option>
                    </el-select>
                  </el-form-item>
                </template>
              </el-table-column>
              <el-table-column width="50" align="center">
                <template slot-scope="scope">
                  <el-form-item>
                    <el-button type="test" style="width: 40px" size="mini" @click="san(scope.row)">...</el-button>
                  </el-form-item>
                </template>
              </el-table-column>
              <el-table-column label="调拨单位" width="120" align="center">
                <template slot-scope="scope">
                  <el-form-item>
                    <el-input v-model="scope.row.comm_unit" disabled></el-input>
                  </el-form-item>
                </template>
              </el-table-column>
              <el-table-column label="调拨数量" width="150" align="center">
                <template slot-scope="scope">
                  <el-form-item>
                    <el-input-number :min="1" :max="200" v-model="scope.row.allocation_amount"></el-input-number>
                  </el-form-item>
                </template>
              </el-table-column>
              <el-table-column label="调拨成本" width="120" align="center">
                <template slot-scope="scope">
                  <el-form-item>
                    <el-input v-model="scope.row.allocation_money" disabled></el-input>
                  </el-form-item>
                </template>
              </el-table-column>
              <el-table-column label="创建时间" width="190" align="center">
                <template slot-scope="scope">
                  <el-form-item>
                    <el-date-picker v-model="scope.row.gmt_create" type="date" placeholder="选择日期" style="width: 180px"></el-date-picker>
                  </el-form-item>
                </template>
              </el-table-column>
              <el-table-column label="修改时间" width="190" align="center">
                <template slot-scope="scope">
                  <el-form-item>
                    <el-date-picker v-model="scope.row.gmt_modified" type="date" placeholder="选择日期" style="width: 180px"></el-date-picker>
                  </el-form-item>
                </template>
              </el-table-column>
              <el-table-column label="备注一" width="200" align="center">
                <template slot-scope="scope">
                  <el-form-item>
                    <el-input v-model="scope.row.remark_one" ></el-input>
                  </el-form-item>
                </template>
              </el-table-column>
              <el-table-column label="备注二" width="200" align="center">
                <template slot-scope="scope">
                  <el-form-item>
                    <el-input v-model="scope.row.remark_two" ></el-input>
                  </el-form-item>
                </template>
              </el-table-column>
              <el-table-column label="备注三" width="200" align="center">
                <template slot-scope="scope">
                  <el-form-item>
                    <el-input v-model="scope.row.remark_three" ></el-input>
                  </el-form-item>
                </template>
              </el-table-column>
            </el-table>
          </el-form>
        </el-tab-pane>
      </el-tabs>
    </div>
  </div>
</template>

<script>
export default {
  name: 'allcationAdd',
  data() {
    return {
      iaForm: {},
      tableData: [
        {
          entry_no: 10,
          comm_id: '',
          depot_callout: '',
          depot_fold: '',
          source_amount: null,
          comm_unit: '',
          allocation_amount: null,
          allocation_money: null,
          remark_one: '',
          remark_two: '',
          remark_three: '',
          gmt_create: null,
          gmt_modified: null
        }
      ],
      detail: {
        entry_no: 10,
        comm_id: '',
        depot_callout: '',
        depot_fold: '',
        source_amount: null,
        comm_unit: '',
        allocation_amount: null,
        allocation_money: null,
        remark_one: '',
        remark_two: '',
        remark_three: '',
        gmt_create: null,
        gmt_modified: null
      }
    }
  },
  methods: {
    addDomain() {
      this.tableData.push({})
    },
    san(data) {
      alert(JSON.stringify(data))
    }
  }
}
</script>

<style scoped>
</style>
